package com.xmh.reptile.entity;

import java.util.Date;
import java.math.BigDecimal;
import java.util.Map;
import java.util.HashMap;
import com.alibaba.fastjson.JSONObject;
import java.sql.Timestamp;
import lombok.Data;
import java.io.Serializable;

@Data
public class AuthorEntity implements Serializable {

	/**
	 * 版本号
	 * 表备注：
	 */
	public static final long serialVersionUID = 2422827135145636096L;

	/**
	 *
	 */
	private Integer id;

	/**
	 *
	 */
	private String realName;

	/**
	 *
	 */
	private String nickName;

	@SuppressWarnings("unchecked")
	public AuthorEntity(String json) {
		this(JSONObject.parseObject(json, Map.class));
	}

	public AuthorEntity() {}

	public AuthorEntity(Map<String, Object> map) {
		if (map == null || map.isEmpty()) {
			return;
		}

		if (map.get("id") != null) {
			id = Integer.valueOf(String.valueOf(map.get("id")));
		}

		realName = (String) map.get("realName");

		nickName = (String) map.get("nickName");

	}

    public Map toMap() {
        Map map = new HashMap();
        map.put("id", id);
        map.put("realName", realName);
        map.put("nickName", nickName);
        return map;
    }


}